<!DOCTYPE html>
<html lang="zh"xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>首页 - 天才(genius)后台管理系统</title>
    <link rel="icon" th:href="@{favicon.ico}" type="image/ico">
    <link href="css/bootstrap.min.css" th:href="@{~/css/bootstrap.min.css}" rel="stylesheet">
    <link href="css/materialdesignicons.min.css" th:href="@{~/css/materialdesignicons.min.css}" rel="stylesheet">
    <link href="css/style.min.css" th:href="@{~/css/style.min.css}" rel="stylesheet">

</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside th:include="left::common" class="lyear-layout-sidebar">
        </aside>
        <!--End 左侧导航-->
        <!--头部信息-->
        <header th:include="head :: common" class="lyear-layout-header">
        </header>
        <!--End 头部信息-->
        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="col-md-12">
                <div class="card">
                  <!--  <div class="card-header"><h4>两端对齐的标签页</h4></div>-->
                    <div class="card-body">

                        <ul class="nav nav-tabs nav-justified">
                            <li class="active">
                                <a data-toggle="tab" href="#home-basic">一级菜单</a>
                            </li>
                            <li class="nav-item">
                                <a data-toggle="tab" href="#profile-basic">二级菜单</a>
                            </li>
                            <li class="nav-item">
                                <a data-toggle="tab" href="#messages-basic">三级菜单</a>
                            </li>

                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane fade active in" id="home-basic">
                                <form id="yi" action="/study-menu/menuadd" method="post">
                                    <!--一级菜单!-->
                                    <table>
                                        <p ><label for="id"><input type="hidden" th:onblur="save()"id="id"name="id"></label></p>
                                        <p><label for="menuCategory"> 菜单级别:<input type="text" th:onblur="save()"id="menuCategory0" name="menuCategory" value="1" hidden="hidden">
                                            <input type="text" th:onblur="save()"id="menuCategory" name="menuCategory" value="1" disabled="disabled">
                                        </label></p>
                                        <p><label for="menuPartentId"> 父级id:<input type="text" th:onblur="save()" id="menuPartentId0" name="menuPartentId" value="0"hidden="hidden">
                                            <input type="text" th:onblur="save()" id="menuPartentId" name="menuPartentId" value="0"disabled="disabled">
                                        </label></p>
                                        <p><label for="menuName"> 菜单名称:<input type="text" th:onblur="save()" id="menuName" name="menuName"></label></p>
                                        <p><label for="displayOrder"> 排列顺序:<input type="text" th:onblur="save()" id ="displayOrder" name="displayOrder"></label></p>
                                        <p><button type="button" class="btn btn-primary" id="svemp" data-toggle="modal"
                                                   data-target=".bs-example-modal-sm">添加</button>
                                        </p>
                                    </table>

                                    <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                                        <div class="modal-dialog modal-sm" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                    <h4 class="modal-title" id="myLargeModalLabel0">菜单新增</h4>
                                                </div>
                                                <div class="modal-body">
                                                    是否确认添加😊
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" onclick="add()" class="btn btn-primary">点击保存</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="tab-pane fade" id="profile-basic">
                                <form id="er" action="/study-menu/menuadd" method="post">
                                    <table>
                                        <p ><label for="id"><input type="hidden" th:onblur="save1()"id="id1"name="id"></label></p>
                                        <p><label for="menuCategory"> 菜单级别:<input type="text" th:onblur="save1()"id="menuCategory1"name="menuCategory" value="2"hidden="hidden">
                                            <input type="text" th:onblur="save1()"id="menuCategory11"name="menuCategory" value="2"disabled="disabled">
                                        </label></p>
                                        <p><label> 父级名称:
                                                <!-- <input type="text"th:onblur="save1()" id="menuPartentId1"name="menuPartentId">-->
                                            <select id="sel2"name="menuPartentId">
                                                <option value="">请选择父类菜单</option>
                                                <option th:each="page:${list0}" id="sss2" th:value="${page.id}">[[${page.menuName}]]</option>
                                            </select>

                                        </label>
                                        </p>
                                        <p><label for="menuName"> 菜单名称:<input type="text"th:onblur="save1()" id="menuName1"name="menuName"></label></p>
                                        <p><label for="displayOrder"> 排列顺序:<input type="text"th:onblur="save1()" id ="displayOrder1"name="displayOrder"></label></p>
                                        <p><label for="menuPath1">路径:<input type="text"th:onblur="save1()" id = "menuPath1"name="menuPath"></label></p>
                                        <p><button type="button" class="btn btn-primary" id="svemp1" data-toggle="modal"
                                                   data-target=".bs-example-modal-sm">添加</button>
                                        </p>
                                    </table>

                                    <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                                        <div class="modal-dialog modal-sm" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                    <h4 class="modal-title" id="myLargeModalLabel1">菜单新增</h4>
                                                </div>
                                                <div class="modal-body">
                                                    是否确认添加😊
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" onclick="add1()" class="btn btn-primary">点击保存</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="tab-pane fade" id="messages-basic">
                                <form id="san" action="/study-menu/menuadd" method="post">
                                    <table>
                                        <p ><label for="id"><input type="hidden" th:onblur="save2()"id="id2"></label></p>
                                        <p><label for="menuCategory"> 菜单级别:<input type="text" th:onblur="save2()"id="menuCategory2"name="menuCategory" value="3"hidden="hidden">
                                            <input type="text" th:onblur="save2()"id="menuCategory22"name="menuCategory" value="3"disabled="disabled">
                                        </label></p>
                                        <p><label> 父级id:
                                        <!--  <input type="text"th:onblur="save2()" id="menuPartentId2"name="menuPartentId">-->
                                            <select id="sel3"name="menuPartentId">
                                                <option value="">请选择父类菜单</option>
                                                <option id="sss3" th:each="page:${list1}" th:value="${page.id}">[[${page.menuName}]]</option>
                                            </select>
                                        </label>
                                        </p>
                                        <p><label for="menuName2"> 菜单名称:<input type="text"th:onblur="save2()" id="menuName2"name="menuName"></label></p>
                                        <p><label for="displayOrder2"> 排列顺序:<input type="text"th:onblur="save2()" id = "displayOrder2"name="displayOrder"></label></p>
                                        <p><label for="menuPath2">路径:<input type="text"th:onblur="save2()" id = "menuPath2"name="menuPath"></label></p>
                                        <p><button type="button" class="btn btn-primary" id="svemp2" data-toggle="modal"
                                                   data-target=".bs-example-modal-sm">添加</button>
                                        </p>
                                    </table>

                                    <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                                        <div class="modal-dialog modal-sm" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                    <h4 class="modal-title" id="myLargeModalLabel2">菜单新增</h4>
                                                </div>
                                                <div class="modal-body">
                                                    是否确认添加😊
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" onclick="add2()" class="btn btn-primary">点击保存</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </main>
        <!--End 页面主要内容-->




    </div>
</div>
<script type="text/javascript" th:src="@{~/js/jquery.min.js}" src="js/jquery.min.js"></script>
<script type="text/javascript" th:src="@{~/js/bootstrap.min.js}" src="js/bootstrap.min.js"></script>
<script type="text/javascript" th:src="@{~/js/perfect-scrollbar.min.js}" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" th:src="@{~/js/main.min.js}" src="js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" th:src="@{~/js/Chart.js}" src="js/Chart.js"></script>
<script type="text/javascript">

    function  add() {
        $("#yi").submit();
    }
    function add1() {
        alert($("#sss2").val())
        $("#er").submit();
    }
    function  add2() {
        $("#san").submit();
    }
    function save() {
        $("#svemp").attr({"disabled": "disabled"});
        var menu_name = $("#menuName").val();
        var menu_category = $("#menuCategory").val();
        var menu_partent_id = $("#menuPartentId").val();
        var id = $("#id").val();
        var display_order = $("#displayOrder").val();
        var menu_path = $("#menuPath").val();
        if (menu_name == "" || menu_name == undefined) {
            $("#msg").html("请输入菜单名称").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }
        $("#svemp").removeAttr("disabled");
    }
    function save1() {
        $("#svemp1").attr({"disabled": "disabled"});
        var menu_name1 = $("#menuName1").val();
        // var menu_partent_id1 = $("#menuPartentId1").val();
        var display_order1 = $("#displayOrder1").val();
       // var menu_path1 = $("#menuPath1").val();
        if (menu_name1 == "" || menu_name1 == undefined) {
            $("#msg").html("请输入菜单名称").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }else if (display_order1 == "" || display_order1 == undefined) {
            $("#msg").html("请输入排列顺序").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }
        $("#svemp1").removeAttr("disabled");
    }
    function save2() {
        $("#svemp2").attr({"disabled": "disabled"});
        var menu_name2 = $("#menuName2").val();
       /* var menu_partent_id2 = $("#menuPartentId2").val();*/
        var display_order2 = $("#displayOrder2").val();
        var menu_path2 = $("#menuPath2").val();
        if (menu_name2 == "" || menu_name2 == undefined) {
            $("#msg").html("请输入菜单名称").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }else if (menu_path2 == "" || menu_path2 == undefined) {
            $("#msg").html("请输入路径").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }else if (display_order2 == "" || display_order2 == undefined) {
            $("#msg").html("请输入排列顺序").show();
            setTimeout(function () {
                $("#msg").hide();
            }, 3000);
            return
        }
        $("#svemp2").removeAttr("disabled");
    }
    function ymone(pn){
        var oneval1=$("#oneval1").val();
        var paginalsizeone1=$("#paginalsizeone1").val();
        var moreval1=$("#moreval1").val();
        var paginalsizemore1=$("#paginalsizemore1").val();
        var shoreval1=$("#shoreval1").val();
        var paginalsizeshort1=$("#paginalsizeshort1").val();
        if(pn==0){
            return
        }
        $("#pnone").attr("value", pn);
        $("#paginalsizeone").attr("value", paginalsizeone1);
        $("#oneval").attr("value", oneval1);
        $("#paginalsizemore").attr("value", paginalsizemore1);
        $("#moreval").attr("value", moreval1);
        $("#paginalsizeshort").attr("value", paginalsizeshort1);
        $("#shoreval").attr("value", shoreval1);
        $("#oms").attr("value", "one");
        $("#biao").submit();

    }
    function ymshore(pn){
        var oneval1=$("#oneval1").val();
        var paginalsizeone1=$("#paginalsizeone1").val();
        var moreval1=$("#moreval1").val();
        var paginalsizemore1=$("#paginalsizemore1").val();
        var shoreval1=$("#shoreval1").val();
        var paginalsizeshort1=$("#paginalsizeshort1").val();
        if(pn==0){
            return
        }
        $("#pnshort").attr("value", pn);
        $("#paginalsizeone").attr("value", paginalsizeone1);
        $("#oneval").attr("value", oneval1);
        $("#paginalsizemore").attr("value", paginalsizemore1);
        $("#moreval").attr("value", moreval1);
        $("#paginalsizeshort").attr("value", paginalsizeshort1);
        $("#shoreval").attr("value", shoreval1);
        $("#oms").attr("value", "shore");
        $("#biao").submit();

    }
    function ymmore(pn){
        var oneval1=$("#oneval1").val();
        var paginalsizeone1=$("#paginalsizeone1").val();
        var moreval1=$("#moreval1").val();
        var paginalsizemore1=$("#paginalsizemore1").val();
        var shoreval1=$("#shoreval1").val();
        var paginalsizeshort1=$("#paginalsizeshort1").val();
        if(pn==0){
            return
        }
        $("#pnmore").attr("value", pn);
        $("#paginalsizeone").attr("value", paginalsizeone1);
        $("#oneval").attr("value", oneval1);
        $("#paginalsizemore").attr("value", paginalsizemore1);
        $("#moreval").attr("value", moreval1);
        $("#paginalsizeshort").attr("value", paginalsizeshort1);
        $("#shoreval").attr("value", shoreval1);
        $("#oms").attr("value", "more");
        $("#biao").submit();

    }
    $(document).ready(function(e) {
        var $dashChartBarsCnt  = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
            $dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );

        var $dashChartBarsData = {
            labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
            datasets: [
                {
                    label: '注册用户',
                    borderWidth: 1,
                    borderColor: 'rgba(0,0,0,0)',
                    backgroundColor: 'rgba(51,202,185,0.5)',
                    hoverBackgroundColor: "rgba(51,202,185,0.7)",
                    hoverBorderColor: "rgba(0,0,0,0)",
                    data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
                }
            ]
        };
        var $dashChartLinesData = {
            labels: ['2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014'],
            datasets: [
                {
                    label: '交易资金',
                    data: [20, 25, 40, 30, 45, 40, 55, 40, 48, 40, 42, 50],
                    borderColor: '#358ed7',
                    backgroundColor: 'rgba(53, 142, 215, 0.175)',
                    borderWidth: 1,
                    fill: false,
                    lineTension: 0.5
                }
            ]
        };

        new Chart($dashChartBarsCnt, {
            type: 'bar',
            data: $dashChartBarsData
        });

        var myLineChart = new Chart($dashChartLinesCnt, {
            type: 'line',
            data: $dashChartLinesData,
        });
    });
</script>
</body>
</html>